package com.kgc.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Author: luo
 * @date: 2024/4/6 22:10
 * @Description:
 * @Version: 1.0
 */
@Component
@Slf4j
//@EnableScheduling
public class MyScheduleTack {
    //定时任务,每隔2秒,打印系统时间
//    @Scheduled(cron = "0/2 * * * * ?")
    public void myTask(){
        log.info("系统时间:{}", LocalDateTime.now());
    }
}
